﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.News
{
    public partial class change_index_cate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string index = Request.QueryString["index"];

            if (index.IndexOf(',') != -1)
            {
                string[] split = new string[index.Split(',').Length];
                split = index.Split(',');
                for (int i = 1; i <= split.Length; i++)
                {
                    var get_cate = new TblNewsCategoryController().FetchAll().Where(x => x.CatId == int.Parse(split[i-1])).Single();
                    new TblNewsCategoryController().Update(get_cate.CatId, null, i, null);
                }
            }
        }
    }
}